FROM python:3.13-slim
# 自定义步骤：设置 apt 源
# RUN echo "deb http://mirrors.huaweicloud.com/debian trixie main" > /etc/apt/sources.list \
RUN sed -i 's/deb.debian.org/mirrors.huaweicloud.com/g' /etc/apt/sources.list.d/debian.sources \
    && apt-get update
RUN apt-get install -y \
    curl \
    git \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY . /app

# 继续交给 BentoML 管理 Python 环境
RUN pip config --user set global.index https://mirrors.huaweicloud.com/repository/pypi
RUN pip config --user set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple
RUN pip config --user set global.trusted-host mirrors.huaweicloud.com
RUN pip install -U pip && pip install bentoml scikit-learn

# 必须能启动 BentoML API Server
EXPOSE 3000
CMD ["bentoml", "serve", "."]
